<template>
  <tr>
    <td><input type="checkbox" v-model="obj.checked" /></td>
    <td>{{ obj.name }}</td>
    <td>{{ obj.price }}</td>
    <td>
      <button @click="RED_NUM(index)">-</button>
      {{ obj.num }}
      <button @click="ADD_NUM(index)">+</button>
    </td>
    <td>{{ obj.num * obj.price }}</td>
    <button @click="DEL_GOOD(index)">删除</button>
  </tr>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
    props: ['obj','index'],
    data () {
        return {
            
        }
    },
    methods: {
      ...mapMutations(["RED_NUM","ADD_NUM","DEL_GOOD"])
    }

}
</script>

<style scoped>
tr{
  text-align: center;
}
</style>